<div class="app-content-body ">
    <div class="bg-light lter b-b wrapper-md hidden-print">
      <h1 class="m-n font-thin h3">会员信息详情</h1>
    </div>

    <div class="form_title">
      <div class="my_hd edit-type">查看</div>
      <div class="crud-container crud-reset">
        <form id="form-container">
          <div class="row">
            <div class="col-sm-12">
              <div id="form"></div>
            </div>
          </div>          
          <div class="row">
            <div class="col-sm-12 text-right" style="margin-top: 15px;">
                <div id="cancel"></div>
            </div>
          </div>
        </form>
      </div>
    </div>
</div>
<script type="text/javascript">
$(function (){
    $("#content").one("route.loaded", function(e, context) {
      var id=context.params.id ,
      	  memberStore = API('user/'+ id);
      	  
      var formItems = [{
	  		itemType: "group",
	  		colCount: 2,
	  		items:[{
		        dataField: "nickname",
		        label: {text: '会员昵称'}, 
		    },{
		        dataField: "email",
		        label: {text: '邮件地址'}, 
		    },{
		        dataField: "mobile",
		        label: {text: '手机号'},
		    },{
		        dataField: "username",
		        label: {text: '会员姓名'},
		    },{
		        dataField: "id_card",
		        label: {text: '身份证'},
		    },{
		        dataField: "is_publish",
		        label: {text: '需求录入创客'},
		    },{
		        dataField: "is_execute",
		        label: {text: '任务执行创客'},
		    },{
		        dataField: "is_manager",
		        label: {text: '项目经理'},
		    },{
		        dataField: "created_at",
		        label: {text: '加入时间'},
	  		}]
      }]
      $.get(memberStore).then(function(msg){
      	  if(msg.data.avatar){
      	  	 $('#form-container').prepend("<div class='mgsImg'><img src='"+msg.data.avatar+"' /></div>");
      	  }
      	  
	   	  $("#form").dxForm({
	   	  	   formData:msg.data,
		       showColonAfterLabel: true,
		       showValidationSummary: false,
		       readOnly: true,
		       validationGroup: "crud",
		       items: formItems
	      }).dxForm("instance");
  	  },'json');
		
      $("#cancel").dxButton({
          text: "返回",
          type: "normal",
          onClick:function() {
            context.redirect("#/members");
          }
      });
    });
});
</script>